<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('考勤规则列表')" />
</head>
<body class="gray-bg">
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('system:rule:edit')}]];
        var removeFlag = [[${@permission.hasPermi('system:rule:remove')}]];
        var prefix = ctx + "system/rule";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "考勤规则",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'id',
                    title: '考勤规则编号',
                    visible: false
                },
                {
                    field: 'suitYear',
                    title: '适用年份'
                },
                {
                    field: 'workDay',
                    title: '工作日星期'
                },
                {
                    field: 'startTime',
                    title: '上班开始时间'
                },
                {
                    field: 'lateTime',
                    title: '上班迟到时间'
                },
                {
                    field: 'absenceTime',
                    title: '旷工时间'
                },
                {
                    field: 'endTime',
                    title: '下班时间'
                },
                {
                    field: 'earlyLeaveTime',
                    title: '早退时间'
                },
                {
                    field: 'newYearHolidays',
                    title: '元旦假期'
                },
                {
                    field: 'springFestivalHolidays',
                    title: '春节假期'
                },
                {
                    field: 'qingmingHolidays',
                    title: '清明假期'
                },
                {
                    field: 'fiveOneHolidays',
                    title: '五一假期'
                },
                {
                    field: 'duanWuHolidays',
                    title: '端午假期'
                },
                {
                    field: 'zhongQiuHolidays',
                    title: '中秋假期'
                },
                {
                    field: 'guoQinHolidays',
                    title: '国庆假期'
                },
                {
                    field: 'otherHolidays',
                    title: '其他假期'
                },
                {
                    field: 'tenantId',
                    title: '租户id'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>